function insert_row(tbody, no_cols, html, attrs) {
	var tbody_obj = document.getElementById(tbody);

	var tr = document.createElement('tr');

	for (var i=0; i<no_cols; i++)
	{
		var td = document.createElement('td');
		
		var text_div = document.createTextNode("");

		if (typeof (html[i]) != 'undefined' )
		{
			//alert(html[i]);
			text_div = document.createElement('div');
			text_div.innerHTML = html[i];
		}

		//Add DIV to TD
		td.appendChild(text_div);
		
		//sets the attribute of TD
		if (typeof (attrs[i]) != 'undefined' )
		{
			for (var key in attrs[i]) 
			{
				//alert(key+":"+attrs[i][key]);
				td.setAttribute(key, attrs[i][key]);
			}
		}

		//Add TD to TR
		tr.appendChild(td);

	}
	//Add TR to TBODY
	tbody_obj.appendChild(tr);
}

function add_url_ro_table(url, class2) {
 
	var attrs = new Array();
	var html = new Array();

	attrs[0] = {"align":"left","bgColor":class2};
	attrs[1] = {"align":"center","bgColor":class2};

	html[0] = '<a href="'+url+'" target="_blank" class="link1">'+url+'</a>';
	html[1] = '<img src="http://pr.blogflux.com/pr3.php?s='+encodeURI(url)+'" align="top" alt="Page Rank" />';
	//html[1] = '<img src="get_rank.php?page='+encodeURI(url)+'" align="top" alt="Page Rank" />';
	
	insert_row('tbody2', 2, html, attrs);
}

function progress_bar(total, current, div) {

	var out = '';

	for (var i=1; i<=total; i++ )
	{
		if (i <= current)
		{
			out += '<font color="#0000FF"><b>*</b></font>';
		}
		else
		{
			out += '<font color="#E5E5E5"><b>*</b></font>';
		}
	}

	document.getElementById(div).innerHTML = out;
}